package com.sky.agent.service.impl;

import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson2.JSONObject;
import com.sky.agent.service.FileTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;


import java.nio.charset.StandardCharsets;
import java.util.Map;

@Slf4j
@Service
public class FileTypeServiceImpl implements FileTypeService {

    @Value("${filePath.fileType}")
    private String fileType;

    @Override
    public Map getFileTypeList() {
        String coffeeStr = FileUtil.readString(this.fileType, StandardCharsets.UTF_8);
        Map map = (Map) JSONObject.parseObject(coffeeStr, Map.class);
        return map;

    }
}
